package sis.studentinfo;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import java.util.Date;

import org.junit.Test;

public class CourseSessionTest extends SessionTest{
   
	@Test
	public void testCourseDates(){
		Date startDate = DateUtil.createDate(2003, 1, 6);
		Session session = createSession(createCourse(),startDate);
		Date sixteenWeeksOut = DateUtil.createDate(2003 , 4, 25);
		assertEquals(sixteenWeeksOut, session.getEndDate());
	}

	@Test
	public void testCount(){
		CourseSession.resetCount();
		createSession(createCourse(), new Date());
		assertEquals(1, CourseSession.getCount());
		createSession(createCourse(), new Date());
		assertEquals(2, CourseSession.getCount());
		
	}
	
	private Course createCourse() {
		// TODO Auto-generated method stub
		return new Course("ENGL", "101");
	}
		
	protected Session createSession(
			Course course,
			Date date){
		return CourseSession.create(course, date);
	}
}
